import unittest

# loader
# TODO loadTestsFromName
# 这儿的参数是字符串类型
# 模块名
# loader1 = unittest.defaultTestLoader.loadTestsFromName('test_cases.test_demo1')

# 类名
# loader1 = unittest.defaultTestLoader.loadTestsFromName('test_cases.test_demo1.Demo1TestCase')

# 方法名
# loader1 = unittest.defaultTestLoader.loadTestsFromName('test_cases.test_demo1.Demo1TestCase.test1')
# loader2 = unittest.defaultTestLoader.loadTestsFromName('test_cases.test_demo2.Demo2TestCase.testb')

# TODO loadTestsFromNames
lists = ['test_cases.test_demo1.Demo1TestCase.test1', 'test_cases.test_demo2.Demo2TestCase.testb']
loader = unittest.defaultTestLoader.loadTestsFromNames(lists)

# suite
suite = unittest.TestSuite()
suite.addTest(loader)

# runner
runner = unittest.TextTestRunner(verbosity=2)
runner.run(suite)